package cn.whut.glab.junit;

import java.sql.SQLException;
import java.util.List;

import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanListHandler;
import org.junit.Test;

import cn.whut.glab.domain.BD_Permission;
import cn.whut.glab.utils.DataSourceUtils;
import java.util.List;

public class connTest {
	@Test
	public void connTest1() throws SQLException{
		QueryRunner runner = new QueryRunner(DataSourceUtils.getDataSource());
		String sql = "select * from BD_Permission";
		List<BD_Permission> list= runner.query(sql, new BeanListHandler<BD_Permission>(BD_Permission.class));
		
		for(BD_Permission per:list){
			System.out.println(per);
			
		}
		
	}
}
